<#assign module="sys"/>


<@override name="header">
<link rel="stylesheet" href="${ctx}/assets/css/bootstrap-switch.min.css">
</@override>
<@override name="body">


<div class="row margin-top area_container">
	<input type="hidden" name="id" value="">
	<div class="col-md-12">
		<div class="panel panel-default">
		  <div class="panel-heading">
		  		<span>公司列表</span>
		  		<button type="button" class="smsmain-save pull-right button button-pill button-flat button-tiny">&nbsp;保存</button>
		  		<span class="pull-right">
		  			<font size="3px">是否使用总公司短信模板</font>
					<input type="checkbox" id="smsMainCompany" name="smsMainCompany"  <#if setting.smsMainCompany>checked</#if>/>
				</span>
          </div>
		  <div class="panel-body">
			<#if companys??>
    			<#list companys as company>
    				<#if isSmsMainCompany=false && !company.companyType>
		    			<div class="btn-group">
		    				<a class="btn btn-default" href="${ctx}/sms/setting/${company.id}" data-value="${company.id}">${company.abbreviation?if_exists}</a>
		    			</div>
    				</#if>
    				<#if company.companyType>
		    			<div class="btn-group">
		    				<a class="btn btn-default" href="${ctx}/sms/setting/${company.id}" data-value="${company.id}">${company.abbreviation?if_exists}<font style="color:red;">（主公司）</font></a>
		    			</div>
    				</#if>
    			</#list>
    		</#if>
			
		  </div>
		</div>
	</div>
</div>


</@override>
<@override name="footer">
<script src="${ctx}/assets/js/bootstrap-switch.min.js"></script>
<script type="text/javascript">


$(document).ready(function(){
	$(document).on("click",".smsmain-save",function(){
	    $.post("${ctx}/sms/saveSmsMainCompany",{"smsMainCompany":$("input[name=smsMainCompany]:checked").val()},function(data){
	    },'json');
	       location.reload();
	});
});

</script>
</@override>
<@extends name="../layout.ftl"/>
